Skip to main content

All Questions

Tagged with
6votes
2answers
1kviews

Advent of Code 2023 day 1: Trebuchet in C (part 2)

Problem description from the Advent of Code website: Part 1: The task involves analyzing a calibration document containing lines of text. Each line represents a calibration value that needs to be ...
virtualcode's user avatar
3votes
1answer
169views

Processing a binary file with buffer length tags

I am trying to process a very large binary file using MappedByteBuffer from java.nio package. This is how the data looks like in the file: ...
SuhasG's user avatar
5votes
2answers
917views

C key: value file parser

I implemented a key:value format file parser in C, or something that comes close to it as there is no such thing as dynamically creating structs in C. Assumptions: we are creating a C program that ...
Samuele B.'s user avatar
5votes
2answers
182views

Running out of fuel near Saturn

Optimizing/parsing files into semi-complex data-structures more efficiently To preface, I'd like to say that this code is part of the Advent of Code 2019 solutions I have been working on. ...
Rietty's user avatar
5votes
1answer
1kviews

Parse data into an array of structs

I'd had a hard time getting this to work. I’d like to parse a file containing data and copy this data into a struct. The data file (test.dat) looks like this: <...
geohei's user avatar
11votes
6answers
11kviews

Parse a simple key=value config file in C

Write a program that should read a file formatted strictly like this below: $ cat sample bingo=2 bingo2=939 bingo3=text The left and right side of ...
Sedmaister's user avatar
5votes
2answers
290views

Simple INI file parser in Haskell

I've written a rudimentary parser for INI files: ...
Matthias Braun's user avatar
3votes
0answers
336views

Parsing version from Cargo.toml

I want to get version from Cargo.toml and use the value inside my app. Here is a function I wrote: ...
philipjkim's user avatar
6votes
2answers
263views

Minimalistic, self-contained class for reading a sectionless INI file

When sections are ignored and no writing capability is needed, an INI reader becomes quite simple to implement. Here is my attempt at reading a sectionless INI file without any non-...
Sparkler's user avatar
2votes
1answer
94views

Count features in a file, using parallel code

When processing large files (say for parsing or performing computations based on the contents), we want to be able to use multiple processes to perform the job faster. In my case I wanted to count ...
Bar's user avatar
  • 121
2votes
1answer
83views

Function that reads big files in C

I made a function that writes all the data from a hashtable to a .txt file and another to read the said data. The data comes from a this type of struct and it should be read into it when called <...
MiguelD's user avatar
3votes
1answer
2kviews

Parse data file and verify checksum

Here's my assignment: Write a program that takes a filename as its only command line argument and prints the results to std::out formatted as follows: The ...
kavi687's user avatar
6votes
1answer
2kviews

Multi-query PHP Parser for SQL files

I have an external project, which needs to run an SQL file containing multiple SQL queries (a bit like mysqldump, if you like, but is user-created, with any kind of SQL statement/definition). PHP ...
Florian Mertens's user avatar
3votes
1answer
211views

Scraping metrics from log files

https://github.com/bodgix/log2metric/pull/1 This is my very first Go program so please forgive any beginner errors. This is a rewrite of a monitoring script I had written in Ruby. Coming from Ruby, ...
bodgix's user avatar
4votes
0answers
224views

File operations using Groovy

The idea is to read a file - "data" - and write the information to a new file - "output" - only if it meets the criteria (if the resource usage is more than a configured threshold). Content of the ...
Here_2_learn's user avatar

153050per page
close